#include <iostream>
#include <bitset>

int main() {
    using namespace std;
    char c = 130;
    cout << "char 型 机器码 =  " << bitset<sizeof(char) * 8>(c) << endl;
    cout << "char 类型格式化输出 有符号的 int 机器码 =  " << bitset<sizeof(int) * 8>(c) << endl;
    printf("char 类型格式化输出 有符号的 int 输出真值 = %d\n", c);
    cout<<"-----------------------------------------------------"<<endl;
    cout << "signed char 型 机器码 =  " << bitset<sizeof(signed char) * 8>(c) << endl;
    printf("signed char 型 机器码的真值  = %hhd\n", c);//1000,0000
    cout<<"-----------------------------------------------------"<<endl;
    cout << "short int 型 机器码 =  " << bitset<sizeof(short int) * 8>(c) << endl;
    printf("有符号的 short int 输出= %hd\n", c);//0000,0000 1000,0000
    cout<<"-----------------------------------------------------"<<endl;
    cout << "unsigned short int 型 机器码 =  " << bitset<sizeof(unsigned short int) * 8>(c) << endl;
    printf("无符号的 unsigned short int 输出= %hu\n", c);// 1111,1111 1000,0000
    return 0;
}